//不要给我WA WA 叫
//一定AC
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <set>
#include <map>
#include <cstring>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <iomanip>
#include <climits>
#define int long long 
#define x first 
#define y second 
using namespace std;
const int N = 1e5 + 10;
int a[N];
void solve()
{
    int n,m;
    cin >> n >> m;
    vector<vector<char>> vc(n,vector<char>(m,0));
    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < m; j++)
        {
            cin >> vc[i][j];
        }
    }
    int ans = 0;
    for(int i = 0; i < n - 1; i++)
    {
        for(int j = 0; j < m - 1; j++)
        {
            if(vc[i][j] == '*' && vc[i][j + 1] == '*' && vc[i + 1][j] == '*' && vc[i + 1][j + 1] == '*')
            {
                ans++;
            }
        }
    }
    cout << ans << endl;
}
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr),cout.tie(nullptr);
    int t = 1;
    while(t -- )  solve();
    return 0;
}
